package com.qn.vo;

import com.qn.enums.InEnumIntEnum;
import com.qn.validation.annotation.AssertTrueOn;
import com.qn.validation.annotation.EnableCondition;
import com.qn.validation.annotation.InEnumInt;
import com.qn.validation.annotation.NotNullOn;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

@Data
@EnableCondition
public class UserNotice {

    @NotNull(message = "通知类型不能为空 0-短信 1-邮件")
    private Integer noticeType;

    @NotNullOn(on = "#noticeType==0", message = "手机号码不能为空")
    private String userMobile;

    @NotNullOn(on = "#noticeType==1", message = "邮箱不能为空")
    private String userEmail;

    @AssertTrueOn(on = "#noticeType==0", message = "必须是男生")
    private Boolean isBoy;

//    @FieldScope(in = {SourceEnum.Constant.APP, SourceEnum.Constant.PORTAL}, message = "字段范围不正确")
//    private String source;

//    @InEnumStr(clazz = InEnumStrEnum.class, message = "字段范围不正确")
//    private String source;

    @InEnumInt(value = InEnumIntEnum.class, message = "来源类型必须是 {value}")
    private Integer source;

    @InEnumInt(value = InEnumIntEnum.class, message = "来源类型必须是 {value}")
    private List<Integer> sourceList;

}